import Component, { mixins } from 'vue-class-component'
import { tableMixins } from '@/mixins'

@Component
export default class extends mixins(tableMixins) {
  // ++++++++++ model ++++++++++
  // ++++++++++ props ++++++++++
  queryPage = this.$Api.appointment.findAllAppointment

  // ++++++++++ data ++++++++++
  get columns(): Array<IColumn> {
    return [
      { key: 'username', label: '用户名' },
      { key: 'outpatientname', label: '门诊' },
      { key: 'doctorname', label: '医生' },
      { key: 'date', label: '预约时间' },
      {
        key: 'state', label: '状态', format: ({ state }) => {
          if (state == "1") {
            return "审核中"
          } else if (state == "2") {
            return "预约成功"
          } else if (state == "3") {
            return "预约失败"
          }
        }
      },
    ]
  }

  // ++++++++++ computed ++++++++++
  // ++++++++++ methods normal ++++++++++
  // ++++++++++ methods event ++++++++++
  // ++++++++++ Lifecycle Hooks ++++++++++
  // ++++++++++ watch ++++++++++
}
